package com.mrdeer.iot.processor;

import com.mrdeer.iot.bean.command.Protocol;
import com.mrdeer.iot.bean.enums.ERTUChannelFlag;
import lombok.extern.slf4j.Slf4j;

/**
 * 数据解码器 抽象类
 *
 * @Author: xie jianchu
 */
@Slf4j
public abstract class ProcessorAbstract implements IDataProcessor {

    private IDataProcessor nextProcessor;

    private ERTUChannelFlag flag;

    @Override
    public IDataProcessor getNextProcessor() {
        return nextProcessor;
    }

    @Override
    public void setNextProcessor(IDataProcessor nextProcessor) {
        this.nextProcessor = nextProcessor;
    }

    public ProcessorAbstract(ERTUChannelFlag flag) {
        this.flag = flag;
    }

    /**
     * 通道检测：前两个字节比较
     *
     * @param protocol
     * @return
     */
    public boolean checkAndGetAvailable(Protocol protocol) {
        return true;
    }
}
